extends Talent

var buff = globalData.infoDs["g_azurlaneBuffs"]
func init():
	name = "空战机动"
func _connect():
	sys.main.connect("onCharaNewChara", self, "onCharaNewChara")

func onCharaNewChara(cha):
	if cha.team == 1:
		if cha.type == sys.CharaClass.TBF:
			cha.addBuff(b_airJD2.new(lv))	
		elif cha.type == sys.CharaClass.CAS:
			cha.addBuff(b_airJD1.new(lv))
		elif cha.type == sys.CharaClass.FIGHT:
			cha.addBuff(b_airJD3.new(lv))

func get_info():
	return "我方所有舰载机获得生存强化：\n轰炸机获得%d%%吸血\n鱼雷机每%d秒获得1层<圣盾>\n战斗机获得%d点机动、装甲"%[lv*10+30, 10-lv, 10+lv*2]

#轰炸机
class b_airJD1 extends "../../azurlane_ctrl/AzurBuff.gd":
	func _init(tlv):
		attInit()
		id = "b_airJD1"
		att.suck = 0.3 + tlv*0.1
		dispel = 2

#鱼雷机
class b_airJD2 extends "../../azurlane_ctrl/AzurBuff.gd":
	var tlv = 1
	func _init(tlv = 1):
		attInit()
		id = "b_airJD2"
		dispel = 2
		self.tlv = tlv
	var num = 3
	func _upS():
		num += 1
		if num >= 10-tlv:
			masCha.buff.addShengDun(masCha, 1)
			num = 0

#战斗机
class b_airJD3 extends "../../azurlane_ctrl/AzurBuff.gd":
	func _init(tlv = 1):
		attInit()
		id = "b_airJD3"
		att.dod = 10+tlv*2
		att.def = 10+tlv*2
		dispel = 2